#include <stdio.h>
#include <stdlib.h>

/*
 * Grades.C
 */
int main(int argc, char** argv) {
  int practical = atoi(argv[1]); // 1
  int exam = atoi(argv[2]); // 2
  char grade[100] = "Fail"; // 3
    if (exam < 40 && practical < 40) { // 4
      fprintf(stderr,"fail\n");  // 5
    } else {
      int combined = (60*exam+40*practical)/100; // 6
      if (combined < 50) { // 7
        fprintf(stderr,"fail\n");  // 8
      } else if (combined >= 50 && combined < 80) { // 9
        fprintf(stderr,"Pass\n");  // 10
      } else if (combined >= 80 && combined < 100) { // 11
        fprintf(stderr,"Pass with distinction\n");  // 12
      }
    }
  return 1; // 13
}
